﻿using HZU.ZP.Data.Interfaces.Resume;
using HZU.ZP.Domain.IService.Resume;
using HZU.ZP.Domain.Model.Resume;
using HZU.ZP.Domain.ServiceImpl.Mappers.Resume;
using System;
using System.Collections.Generic;
using System.Text;

namespace HZU.ZP.Domain.ServiceImpl.PCSvc.Resume
{
    public class JobIntentionService:IJobIntentionService
    {
        private JobIntentionMapper _mapper = new JobIntentionMapper();
        private IJobIntentionDao _sqlData;
        public JobIntentionService(IJobIntentionDao sqlData)
        {
            _sqlData = sqlData;
        }

        public bool AddJobIntention(JobIntention jobIntention)
        {
            var jobIntDao = _mapper.MapToDao(jobIntention);
            _sqlData.AddJobIntention(jobIntDao);
            return true;
        }

        public bool DeleteJobIntention(int id)
        {
            _sqlData.DeleteJobIntention(id);
            return true;
        }

        public JobIntention GetJobIntention(int applicantId)
        {
            return _mapper.MapToDomain(_sqlData.GetJobIntention(applicantId));
        }

        public bool UpdataJobIntention(JobIntention jobIntention)
        {
            var jobIntDao = _mapper.MapToDao(jobIntention);
            _sqlData.UpdataJobIntention(jobIntDao);
            return true;
        }
    }
}
